package model.entities;
// Generated Dec 25, 2013 4:41:07 AM by Hibernate Tools 3.2.1.GA


import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;


/**
 * Category generated by hbm2java
 */
@Entity
@Table(name="category"
    ,catalog="bocauchithu"
)
public class Category  implements java.io.Serializable {


     private Integer id;
     private String name;
     private String description;
     private Set<Post> posts = new HashSet<Post>(0);

    public Category() {
    }

    public Category(String name, String description, Set<Post> posts) {
       this.name = name;
       this.description = description;
       this.posts = posts;
    }
   
     @Id @GeneratedValue(strategy=IDENTITY)
    
    @Column(name="id", unique=true, nullable=false)
    public Integer getId() {
        return this.id;
    }
    
    public void setId(Integer id) {
        this.id = id;
    }
    
    @Column(name="name", length=45)
    public String getName() {
        return this.name;
    }
    
    public void setName(String name) {
        this.name = name;
    }
    
    @Column(name="description", length=200)
    public String getDescription() {
        return this.description;
    }
    
    public void setDescription(String description) {
        this.description = description;
    }
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.EAGER, mappedBy="category")
    public Set<Post> getPosts() {
        return this.posts;
    }
    
    public void setPosts(Set<Post> posts) {
        this.posts = posts;
    }




}


